package com.oo.inherit_3.car;

/**
 * Car--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 11:28
 **/
public class Car {

    private Engine engine;

    private String no;

    private String type;

    public Car(Engine engine, String no, String type) {
        this.engine = engine;
        this.no = no;
        this.type = type;
    }

    protected void run() {
        System.out.println("车牌为：" + this.getNo() + "的" + this.getType() + "启动。。。"
        +"\n发动机开始工作\n型号："+this.getEngine().getTypeNo()
        +"\n排量："+this.getEngine().getDisplacement()
        +"\n气缸数："+this.getEngine().getNumber());


    }

    public Engine getEngine() {
        return engine;
    }

    public void setEngine(Engine engine) {
        this.engine = engine;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
